 try{
	
	 //alert("a");
	  function jsSelectItemByValue(objSelect_id,objItemText) {  
		  
		var objSelect=  document.getElementById(objSelect_id);
	        for(var i=0;i<objSelect.options.length;i++) {  
	            if(objSelect.options[i].value == objItemText) {  
	                objSelect.options[i].selected = true;  
	                break;  
	            }  
	        }  
	    }  
	function copyImg(controlId)
	{
	 
				var Url2=document.getElementById(controlId); 
			//	alert(Url2.src);
				controlRange = document.body.createControlRange(); 
			//	alert("a1");
				controlRange.addElement(Url2);
			//	alert("a2");
				controlRange.execCommand('Copy');  
	}
	 
	  function  submitConfirm(){
			// document.getElementsByName("submit").item(0).click();
			
			var code=document.getElementById('captcha').value;
		 	if(code.length==4)
		 	{
		 		if(confirm("验证码已经填写上了，需要提交吗"))
		 			document.getElementsByName("submit").item(0).click();//exit timer
		 	}else
		 			window.setTimeout(submitConfirm,4000);		 			
			
			}	
		
		
		function setAns(s)
		{
			//alert(s);
			try{ 
				  s=s.replace("=?","");
				   var rzt=eval(s);
				  document.getElementById('answer').value=rzt;	
			}catch(e)
			{
				//invok java prob lib solu
			}
		//	  document.getElementById('captcha').value="";
			document.getElementById('captcha').focus();
			
		//	alert(rzt);
			  try{
			//for invok raw check for can suto sumbit
		//	  checkanswer(rzt);
			  }catch(e)
			  {
				  alert(e);
			  }
			 
			  //end
		}
		
		//auto setQuestAns 
		  function getQuest()
		  {
			//  window.clearInterval(int)
			  var s=  document.getElementById('questionstr').innerText;
		 
				if(s.length>0)
					{
					window.clearInterval(cyc_id);
					 
						setAns(s);
					 
					
				 
					}
					
			  
		  }
		// captch png 
		  function crackCaptch()
		  {
			//  window.clearInterval(int)
		 
			  var img=  document.getElementById('captchapng');
				if( img.width>10)
					{
					window.clearInterval(crackCaptch_handle);
					 
				     copyImg("captchapng");
					 mycallJava("getCaptch");
					}
					
			  
		  }
	 
	  document.getElementsByName("post[typeid]").item(0).value="0";
	  document.getElementsByName("post[catid]").item(0).value="@catid";
	  document.getElementById('title').value='@title';
	  document.getElementsByName("post[brand]").item(0).value="产品品牌";
	  document.getElementsByName("post[content]").item(0).value="@content";
	  document.getElementsByName("post[thumb]").item(0).value="@thumb";
	 
	   reloadquestion(); 
	   //reloadquestion();
	//   showcaptcha();
	  
		
	var cyc_id=  window.setInterval(getQuest,2000);
	
 	var crackCaptch_handle=  window.setInterval(crackCaptch,2000);
	
	// $("#username").value="aaa";
//	 alert($("#username").value);
	//document.getElementById('password').value='000000';
	
	// var arrP4a=document.getElementsByName("submit");
//	 alert("a10:"+arrP4a);
//	 var a1=arrP4a[0];
//	 alert("a1:"+a1);
//	 var a2=arrP4a.item(0);
//	 alert("a2:"+a2);
	window.setTimeout(function(){
		// document.getElementsByName("submit").item(0).click();
		
	},1000);
	
	//window.setTimeout(function(){
	//	alert("start to pub");
		//window.location="http://localhost/destoon/member/my.php?mid=5&action=add&aP4=js";
	//},25000);
  
	 }catch(e)
	 {
		 
	//  alert(e.number+":"+e.message);
	 }